nutanixPortal
    .config(function ($stateProvider, $urlRouterProvider){
        $urlRouterProvider.otherwise("/router");


        $stateProvider
            //页面跳转，当打开无定向页面时跳转
            .state('router', {
                url: '/router',
                templateUrl: 'route.html',
            })
            .state('error', {
                url: '/error',
                templateUrl: '404.html'
            })

        
            //------------------------------
            // HOME
            //------------------------------
            .state ('app', {
                url: '/app',
                templateUrl: 'views/home.html'
            })

            .state ('app.dashboard', {
                url: '/dashboard',
                templateUrl: 'views/dashboard.html',
                resolve: {
                    loadPlugin: function($ocLazyLoad) {
                        return $ocLazyLoad.load ([
                            {
                                name: 'css',
                                insertBefore: '#app-level',
                                files: [
                                    'vendors/bower_components/fullcalendar/dist/fullcalendar.min.css',
                                ]
                            },
                            {
                                name: 'vendors',
                                insertBefore: '#app-level-js',
                                files: [
                                    'vendors/sparklines/jquery.sparkline.min.js',
                                    'vendors/bower_components/jquery.easy-pie-chart/dist/jquery.easypiechart.min.js',
                                    'vendors/bower_components/simpleWeather/jquery.simpleWeather.min.js'
                                ]
                            }
                        ])
                    }
                }
            })
            //虚拟机界面
            .state('app.virtualMachine', {
                url: '/virtualMachine',
                templateUrl: 'views/virtualMachine.html',
                resolve: {
                    loadPlugin: function($ocLazyLoad) {
                        return $ocLazyLoad.load ([
                            {
                                name: 'css',
                                insertBefore: '#app-level',
                                files: [
                                    'vendors/bower_components/chosen/chosen.min.css'
                                ]
                            },
                            {
                                name: 'vendors',
                                files: [
                                    'vendors/bower_components/chosen/chosen.jquery.js',
                                    'vendors/bower_components/angular-chosen-localytics/chosen.js'
                                ]
                            }
                        ])
                    }
                }
            })
            //kvm管理页面
            .state('app.kvmManage', {
                url: '/kvmManage',
                templateUrl: 'views/kvmManage.html',
                resolve: {
                    loadPlugin: function($ocLazyLoad) {
                        return $ocLazyLoad.load ([
                            {
                                name: 'css',
                                insertBefore: '#app-level',
                                files: [
                                    'vendors/bower_components/chosen/chosen.min.css'
                                ]
                            },
                            {
                                name: 'vendors',
                                files: [
                                    'vendors/bower_components/chosen/chosen.jquery.js',
                                    'vendors/bower_components/angular-chosen-localytics/chosen.js'
                                ]
                            }
                        ])
                    }
                }
            })
            //硬盘页，未使用
            .state('app.cloudDisk', {
                url: '/cloudDisk',
                templateUrl: 'views/clouddisk.html',
                resolve: {
                    loadPlugin: function($ocLazyLoad) {
                        return $ocLazyLoad.load ([
                            {
                                name: 'css',
                                insertBefore: '#app-level',
                                files: [
                                    'vendors/bower_components/chosen/chosen.min.css'
                                ]
                            },
                            {
                                name: 'vendors',
                                files: [
                                    'vendors/bower_components/chosen/chosen.jquery.js',
                                    'vendors/bower_components/angular-chosen-localytics/chosen.js'
                                ]
                            }
                        ])
                    }
                }
            })
            //网络页面
            .state('app.network', {
                url: '/network',
                templateUrl: 'views/network.html',
                resolve: {
                    loadPlugin: function($ocLazyLoad) {
                        return $ocLazyLoad.load ([
                            {
                                name: 'css',
                                insertBefore: '#app-level',
                                files: [
                                    'vendors/bower_components/chosen/chosen.min.css'
                                ]
                            },
                            {
                                name: 'vendors',
                                files: [
                                    'vendors/bower_components/chosen/chosen.jquery.js',
                                    'vendors/bower_components/angular-chosen-localytics/chosen.js'
                                ]
                            }
                        ])
                    }
                }
            })
            //登录页
            .state('login', {
                url: '/login',
                templateUrl: 'login.html',
            })
    });
